command -v rclone
if [[ $? -eq 1 ]]
then
  sudo -v ; curl https://rclone.org/install.sh | sudo bash
fi

DIR=$( dirname "$(readlink -f  ${BASH_SOURCE[0]})" )

rclone config show | grep -E '^\[webdav\]$'

if [[ $? -eq 1 ]]
then
  expect ${DIR}/pass.expect
fi
echo "--------------start show config list --------------"
rclone config show
sudo cat /etc/fuse.conf | grep -E "^\s+user_allow_other"
if [[ $? -eq 1 ]]
then
  # sudo sed -i '$a\user_allow_other' /etc/fuse.conf
  sudo sed -i 's/.*#.*user_allow_other/user_allow_other/g' /etc/fuse.conf
fi
sudo cp -rvf ${DIR}/rclone_mount.service /etc/systemd/system/
sudo systemctl enable rclone_mount.service
sudo systemctl restart rclone_mount.service
